<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<html>
<head>
<title></title>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,border:false,footer:'#fb'">
		<form id="fm">
			<table class="form-layout w90 p-t-10 p-r-30">
				<tr>
					<td>资源代码：</td>
					<td><input name="code" class="easyui-textbox" data-options="required:true" validType="maxLength[30]" /></td>
				</tr>
				<tr>
					<td>资源名称：</td>
					<td><input name="name" class="easyui-textbox" data-options="required:true" validType="maxLength[50]" /></td>
				</tr>
				<tr>
					<td>资源类型：</td>
					<td><input name="type" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/option/zylx',required:true" /></td>
				</tr>
				<tr>
					<td>资源图标：</td>
					<td><input name="icon" class="easyui-textbox" validType="maxLength[50]" /></td>
				</tr>
				<tr>
					<td>资源路径：</td>
					<td><input name="url" class="easyui-textbox" validType="maxLength[500]" /></td>
				</tr>
				<tr>
					<td>资源顺序：</td>
					<td><input name="sort" class="easyui-numberspinner" data-options="required:true,min:0,max:10000" /></td>
				</tr>
				<tr>
					<td>是否显示：</td>
					<td><input name="display" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/option/sfbj',required:true" /></td>
				</tr>
				<tr>
					<td>上级资源：</td>
					<td><input name="pid" class="easyui-combotree" data-options="url:'${CTX}/mgt/sys/res/tree'" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="fb">
		<a id="save" class="form-btn success">确定</a>
	</div>
</body>
<script>
	$(function() {
		$('#save').click(function() {
			if (!$('#fm').form('validate')) {
				return;
			}
			$.mask();
			$.ajax({
				url : '${CTX}/mgt/sys/res/insert',
				data : $('#fm').serialize(),
				success : function(data) {
					$.unmask();
					$.handle(data, function() {
						$.close();
					});
				}
			});
		});
	});
</script>
</html>